/**
 * @Description: 订单列表-订单原型
 * @author tao.xie
 * @date 2019-02-25
 */

import StoreOrder from './StoreOrder.js'

export default class Order {
  /**
   * 订单列表-订单原型
   * @param orderID
   * @param orderState
   * @param commentState
   * @param createTime
   * @param groupState
   * @param orderType
   * @param stype
   * @param groupID
   * @param storeOrder
   * @param skusFee
   * @param couponFee
   * @param postalFee
   * @param payFee
   * @param finalPrice
   * @param expressNo
   * @param expressID
   * @param op
   * @param ticketState
   */
  constructor (orderID, orderState, commentState, createTime, groupState, orderType, stype, groupID, storeOrder, skusFee, couponFee, postalFee, payFee, finalPrice, expressNo, expressID, op, ticketState) {
    this.orderID = orderID
    this.orderState = orderState
    this.commentState = commentState
    this.createTime = createTime
    this.groupState = groupState
    this.orderType = orderType
    this.stype = stype
    this.groupID = groupID
    this.storeOrder = []
    this.skusFee = skusFee
    this.couponFee = couponFee
    this.postalFee = postalFee
    this.payFee = payFee
    this.finalPrice = finalPrice
    this.expressNo = expressNo
    this.expressID = expressID
    this.op = op
    this.ticketState = ticketState
    
    storeOrder.map(store=>{
      this.storeOrder.push(new StoreOrder(
        store.STORE_ID,
        store.STORE_NAME,
        store.STORE_LOGO,
        store.SKU_LIST
      ))
    })
  }
}
